import torch

ny, nx = 20, 20
yv, xv = torch.meshgrid([torch.arange(ny), torch.arange(nx)])
print(yv, xv)